package com.hyz.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.hyz.pojo.IsComplete;
import com.hyz.pojo.assetSecondment.AssetSecondment;
import com.hyz.pojo.assetSecondment.AssetSecondmentResultEnum;
import com.hyz.pojo.assetSecondment.AssetSecondmentStatusEnum;
import com.hyz.service.AssetSecondmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author HGD
 * @date 2022/10/4 23:57
 */
@RestController
@RequestMapping("/assetSecondment")
public class AssetSecondmentController {
    @Autowired
    private AssetSecondmentService service;

    @PostMapping("/updateAssetSecondmentById")
    public Boolean updateAssetSecondmentById(@RequestBody AssetSecondment assetSecondment) {
        return service.updateById(assetSecondment);
    }

    @PostMapping("/getAssetSecondments")
    public List<AssetSecondment> getAssetSecondments(@RequestBody AssetSecondment assetSecondment) {
        QueryWrapper<AssetSecondment> wrapper = new QueryWrapper<>(assetSecondment);
        return service.list(wrapper);
    }
}
